package practiceSelenium.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class BasePage {
    private WebDriver driver;

    public BasePage(WebDriver driver) {
        this.driver = driver;
    }

    public WebElement find(By by) {
        return this.driver.findElement(by);
    }

    public void click(By by) {
        try {
            this.driver.findElement(by).click();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public void sendMsg(By by, String msg) {
        this.driver.findElement(by).sendKeys(msg);
    }
}
